package org.reliablesource.prism.gef.editor.commands;

import org.eclipse.gef.commands.Command;
import org.reliablesource.prism.gef.editor.model.ScreenAdapter;



/**
 * A command to add a IPrismScreen to a ScreenAdapter.
 * The command can be undone or redone.
 */
public class PrismScreenCreateCommand 
extends Command 
{
	
	/** ScreenAdapter to add to. */
	private final ScreenAdapter screen;
	
	/**
	 * Create a command that will add a new IPrismScreen to a ScreenAdapter.
	 * @param textPopUp the new PolygonModel that is to be added
	 * @param screen the ScreenAdapter that will hold the new element
	 * @throws IllegalArgumentException if any parameter is null, or the request
	 * 						  does not provide a new PolygonModel instance
	 */
	public PrismScreenCreateCommand(final ScreenAdapter parent) {
		screen = parent;
		setLabel("Model creation");
	}
	
	/**
	 * Can execute if all the necessary information has been provided. 
	 * @see org.eclipse.gef.commands.Command#canExecute()
	 */
	public boolean canExecute() {
		return screen != null;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.gef.commands.Command#execute()
	 */
	public void execute() {
		redo();
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.gef.commands.Command#redo()
	 */
	public void redo() {
//		screen.addChild(this.textPopUp);
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.gef.commands.Command#undo()
	 */
	public void undo() {
//		screen.removeChild(this.textPopUp);
	}
	
}